<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('tms物品信息列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label>物料号：</label>
                                <input type="text" name="matnrMain"/>
                            </li>
                            <li>
                                <label>子件码：</label>
                                <input type="text" name="fbarcode"/>
                            </li>

                            <li>
                                <label>入库单号：</label>
                                <input type="text" name="inStockId"/>
                            </li>
                            <li>
                                <label>状态：</label>
                                <select name="status">
                                    <option value="-1">已扫描</option>
                                    <option value="0">已扫全</option>
                                </select>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                    <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="tmsMatnr:tmsMatnr:export">
                    <i class="fa fa-download"></i> 导出
                </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('tmsMatnr:tmsMatnr:edit')}]];
        var removeFlag = [[${@permission.hasPermi('tmsMatnr:tmsMatnr:remove')}]];
        var prefix = ctx + "tmsMatnr/tmsMatnr";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "tms物品信息",
                clickToSelect: true,//是否启用点击选中行
                striped: true, //是否显示行间隔色
                pagination: true,//显示分
                columns: [{
                    checkbox: true
                },
                {
                    field: 'matnr',
                    title: '子物料号'
                },
                {
                    field: 'maktx',
                    title: '物料名称'
                },
                {
                    field: 'matnrMain',
                    title: '物料号'
                },
                {
                    field: 'ykutxt',
                    title: '款式'
                },
                {
                    field: 'ewbez',
                    title: '规格'
                },
                {
                    field: 'yyantxt',
                    title: '颜色'
                },
                {
                    field: 'funit',
                    title: '基本单位'
                },
                {
                    field: 'fpackunit',
                    title: '包装单位'
                },
                {
                    field: 'fflag',
                    title: '主序列标识'
                },
                {
                    field: 'barcode',
                    title: '母件码'
                },
                {
                    field: 'fbarcode',
                    title: '子件码'
                },
                {
                    field: 'num',
                    title: '子件总数'
                },
                {
                    field: 'fnum',
                    title: '子件单数'
                },
                {
                    field: 'inStockId',
                    title: '入库单号'
                },
                {
                    field: 'inStockDId',
                    title: '单行号'
                },
                {
                    field: 'fid',
                    title: '序号'
                },
                {
                    field: 'outStockId',
                    title: '出库单号'
                },
                {
                    field: 'outStockDId',
                    title: '出库单id'
                },
                {
                    field: 'status',
                    title: '状态'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        // actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.fbarcode + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.fbarcode + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>